package per.joker;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author joker
 * @date 2022/5/12 0012 - 17:25
 */
public class Test01 {
//    static ApplicationContext ioc = new ClassPathXmlApplicationContext("ioc.xml");

    public static void main(String[] args) {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("ioc.xml");
        ApplicationContext ioc2 = new ClassPathXmlApplicationContext("ioc.xml");
//        1.获取实例
        Person p1 = ioc.getBean("p1", Person.class);
        Person p2 = ioc2.getBean("p1", Person.class);
        System.out.println(p1==p2);
//        //2.构造器获取实例
//        Person p2 = ioc.getBean("p2", Person.class);
//        System.out.println(p2);
//        //3.有对象的
//        Person p3 = ioc.getBean("p3", Person.class);
//        System.out.println(p3);


    }

}
